@echo off

if "%1" == "hide" goto begin
mshta vbscript:createobject("wscript.shell").run("""%~nx0"" hide",0)(window.close)&&exit

:begin
SETLOCAL

::set TARS="tarsAdminRegistry,tarsconfig,tarslog,tarsnode,tarsnotify,tarspatch,tarsproperty,tarsqueryproperty,tarsquerystat,tarsregistry,tarsstat"
::set TARS="tarsconfig,tarsnode,tarsnotify,tarsqueryproperty,tarsquerystat,tarsregistry"
set TARS="tarsnode"

:loop

@echo off
for /f "Tokens=1,* Delims=," %%a in (%TARS%) do (
    echo "restart %%a"

    call TARS_PATH\%%a\util\stop.bat
    call TARS_PATH\%%a\util\start.bat

    set TARS="%%b"

    goto :loop
)

@echo off
ENDLOCAL

